package com.qingke.oms.pojo;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="shop")
public class Shop {
	@Id
	@Column(name="id")
	private int id;
	
	@ManyToOne
	@JoinColumn(name="owner_id")
	private User owner;
	
	@Column(name="name")
	private String name;
	
	@Column(name="turnover")
	private double turnover;
	
	@Column(name="description")
	private String description;
	
	@OneToMany(mappedBy="shop",fetch=FetchType.LAZY)
	private Set<GoodsStatistic> goodsStatistics;
	
	@OneToMany(mappedBy="shop",fetch=FetchType.LAZY)
	private Set<Order> orders;
	
	@OneToMany(mappedBy="shop",fetch=FetchType.LAZY)
	private Set<ShelfRecord> shelfRecords;
	
	@OneToMany(mappedBy="shop",fetch=FetchType.LAZY)
	private Set<ShipmentRecord> shipmentRecords;
	
	@OneToMany(mappedBy="shop",fetch=FetchType.LAZY)
	private Set<ShoppingCart> shoppingCarts;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public User getOwner() {
		return owner;
	}

	public void setOwner(User owner) {
		this.owner = owner;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public double getTurnover() {
		return turnover;
	}

	public void setTurnover(double turnover) {
		this.turnover = turnover;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Set<GoodsStatistic> getGoodsStatistics() {
		return goodsStatistics;
	}

	public void setGoodsStatistics(Set<GoodsStatistic> goodsStatistics) {
		this.goodsStatistics = goodsStatistics;
	}

	public Set<Order> getOrders() {
		return orders;
	}

	public void setOrders(Set<Order> orders) {
		this.orders = orders;
	}

	public Set<ShelfRecord> getShelfRecords() {
		return shelfRecords;
	}

	public void setShelfRecords(Set<ShelfRecord> shelfRecords) {
		this.shelfRecords = shelfRecords;
	}

	public Set<ShipmentRecord> getShipmentRecords() {
		return shipmentRecords;
	}

	public void setShipmentRecords(Set<ShipmentRecord> shipmentRecords) {
		this.shipmentRecords = shipmentRecords;
	}

	public Set<ShoppingCart> getShoppingCarts() {
		return shoppingCarts;
	}

	public void setShoppingCarts(Set<ShoppingCart> shoppingCarts) {
		this.shoppingCarts = shoppingCarts;
	}

	
}
